# -*- coding: utf-8 -*-
"""
@Time    : 2024/6/25 19:52 
@Author  : ZhangShenao 
@File    : extension_module.py 
@Desc    : 扩展模块
"""

from flask_migrate import Migrate
from injector import Module, Binder

from internal.extension import db, migrate
from pkg.sqlalchemy import SQLAlchemy


class ExtensionModule(Module):
    """扩展模块的依赖注入"""

    def configure(self, binder: Binder) -> None:
        binder.bind(SQLAlchemy, to=db)  # 绑定SQLAlchemy数据库
        binder.bind(Migrate, to=migrate)  # 绑定Migrate数据库迁移工具
